Repository navigation
feat(pm-console): type-check the console before it is deployed - #13628
Merged
Merged
Conversation
Add pm-stack/console/tsconfig.json (strict, noEmit, bundler module resolution, allowImportingTsExtensions, skipLibCheck, allowJs, bun + workers types over src, edge/src, test and scripts; typeRoots point into edge/node_modules, where the deploy installs). Add typescript, @types/bun and @cloudflare/workers-types as devDependencies of pm-stack/console/edge, and a "Type-check the console" step before the tests in pm-console-edge-deploy.yml and in the nightly pm-stack-tests.yml. Fix the 56 complaints tsc had on 2026-11-23, none of them a fault: byte arrays typed for the newer BufferSource, the fetch stand-ins kept as typeof fetch, unknown JSON in tests given shapes, and the board rows' type in work.ts made honest. Type-only throughout; the one runtime-adjacent change copies the bytes of a public file into a fresh Uint8Array when it is cached, which changes nothing it serves.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 47 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #13498.
The console's ~20k lines of TypeScript are now type-checked before they are deployed:
pm-stack/console/tsconfig.json— as the issue specifies:strict,noEmit,moduleResolution: bundler,allowImportingTsExtensions,skipLibCheck,allowJs, typesbun+@cloudflare/workers-types, coveringsrc,edge/src,test,scripts. One addition the spec's layout needs:typeRootspoints intoedge/node_modules, because the dependencies live inedge/(where the deploy runsnpm ci) while the tsconfig sits one level up.pm-stack/console/edge:typescript^7.0.2 (the version npm resolves today;pm-stack/voice-line-workeralready pins ^7.0.2),@types/bun^1.4.5,@cloudflare/workers-types^5.20261123.1.pm-console-edge-deploy.yml(after annpm cistep for the tools) and in the nightlypm-stack-tests.ymlbefore "Test console".BufferSource(the base64url helpers and HKDF now sayUint8Array<ArrayBuffer>; casts at the remaining WebCrypto boundaries), the fetch stand-ins kept astypeof fetch(the platform's fetch value lacks bun'spreconnect, soplain(...)'s result is asserted totypeof fetch— the same shape asdirect.ts's existing cast),unknownJSON in tests given shapes, literal widening in test fixtures, and one real type worth fixing at the source:Work.task's rows now declareRow & { url: string | null }, soboard()'s rows carry the fields the tests always read. All type-only except one behaviour-identical change: a cached public file's bytes are copied into a freshUint8Arraywhen read from disk.Verification (laptop, this branch):
npm cifrom the committed lockfile, thennpx tsc --noEmit -p ../tsconfig.json→ exit 0, zero errors (the exact sequence the new workflow steps run).node build.mjsinedge/→ builds.bun testinpm-stack/console: 364 tests. The first full run under heavy host load (load average 105–217 from the lane fleet) showed 7 timing failures — four 5 s timeouts and timing-sensitive races; every one passes on re-run, the fulledge.test.tspasses 108/108 on this branch and on a pristine-main control worktree, and the platform/release files pass clean. No assertion was weakened and no test was changed in behaviour — test edits are annotations and casts only.Lane OC3, under Drew's 2026-11-23 12:09 CST approval of this item. Lane AAN's flagged worktree was not touched; this work was recreated fresh.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.